What is the difference between fgetc, fputc, getc, and putc in C language? getcputc
When I was reading a book, I found these four functions and wanted to know their differences. Results online query found that many people said that fgetc, fputc f
Read the book, found the four functions, want to know their differences. Results Online Search found that many people say that fgetc, FPUTC F represents the file, that is, these two functions are related to files! But a look at their function
C language Getc () function: Reading characters from the streamheader file:
#include
The function getc () is used to extract characters from the stream, and its prototype is as follows:
int getc (FILE *stream);
The
fopen (Open file)
Defining functions
FILE * fopen(const char * path,const char * mode);
Function description
Parameter The path string contains the file path and filename to open, and the parameter mode
Buffer-related operations are common operations that allow input and output of our characters. In fact, after accessing the operating system and compilation principles, it seems that the computer is actually processing strings. Today we will
C language Getc () function: Reading characters from the streamheader file:
#include
The function getc () is used to extract characters from the stream, and its prototype is as follows:
int getc (FILE *stream);
The
First, these two functions are not functions in the C standard library,
Int getch (void) // read a character from the standard input. When you enter the character on the keyboard, the screen does not display the character you entered. That is, do
Two original posts: http://www.cnblogs.com/younes/archive/2010/01/05/1639482.html
Http://blog.csdn.net/cxyol/archive/2006/03/18/628324.aspx
FirstTwo functions are not functions in the c Standard Library:
Int getch (void) // read a character from
fopen (Open file)Correlation function Open,fclose
Table header file #include
Defines the function FILE * fopen (const char * path,const char * mode);
The function description parameter path string contains the file path and filename to open, and
Linux-fopen-fclose-fread-fwrite and other functions
Clearerr (error flag for clearing file streams)
Related functions
Feof
Header file
# Include
Define functions
Void clearerr (File * stream );
Function Description
Clearerr () clears the error
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.